<link type="text/css" rel="stylesheet" href="css/services.css"/>
<style type="text/css">
    .filter{
        width: 200px;
        height: 28px;
        overflow: hidden;
        background: url("images/dropdown.png") no-repeat right #ddd;
        border: 0;
        float: right;
        margin-right: 200px;
    }

    .filter select{
        background: transparent;
        width: 225px;
        line-height: 1;
        padding: 5px;
        border: none;
        border-radius: 1px;
        -webkit-appearance: none;
    }

    #frm_dm{
        margin-top: 50px;
    }
    
    .type1{
        float: none;
    }
	.imageButtonSmall{float:none;}
</style>
﻿<div class="container type1">
		<h1>Báo cáo</h1>
	<?php echo form_open(current_url(),"id='formchange'"); ?>	
                
               <div>
                <span style="display:inline; margin-top: 5px; position: relative; float: left;margin-left:180px;">Chọn:</span>
                <div class="filter">
                <?php echo $combobox_cats;?>
                </div>
                    </div>
                <br style="clear:both;" />
	<?php echo form_close(); ?>
	<div id="IN">
		<!-- Intial display for screen -->
		<center><h1><?php echo $table_name;?></h1></center>
<table>
	<tr>
	  <?php

                foreach( $rules as $i ){
                    if( in_array( $i[ 'field_id' ], $master_limited  ) )
                        echo "<th class='".$i['class']."' style='".$i['style']."'>". $i[ 'label' ]."</th>";
                }
            ?>
	</tr>
	 <?php
                for( $i = 0; $i < count( $results ); $i++ ){
					$odd='';
					if($i%2!=0) $odd='odd';
                    echo "<tr class='$odd'>";
                            foreach( $rules as $item ){
                           	    if( $item[ 'field_id' ] != "Image_ID" && in_array( $item[ 'field_id' ], $master_limited ) ){	        
         			                echo "<td>";
									if($item[ 'control' ] != "time")
										echo $results[ $i ][ $item[ 'field_id' ] ];
									else echo date("d/m/y",$results[ $i ][ $item[ 'field_id' ] ]);
            						echo "</td>";					
    					}?>
                         
                        <?php 
                            }
                    echo "</tr>";
                }
            ?>
	</table>
</div>
                <input type="image" id="button_submit" name="button_submit" value="In" class="imageButtonSmall" onclick="printPartOfPage('IN');" style="margin-bottom: 30px; padding-right: 50px" />
<script type="text/javascript">
           function printPartOfPage(elementId)
             {
                var printContent = document.getElementById(elementId);
                var windowUrl = 'about:blank';
                var uniqueName = new Date();
                var windowName = 'Print' + uniqueName.getTime();
                var printWindow = window.open(windowUrl, windowName, 'left=50,top=50,width=500,height=500');
                 printWindow.document.write('<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>CSS/print.css" />');
				
                                                               printWindow.document.write("<center></center>"+printContent.innerHTML+"<center><input type='button' onclick='self.focus(); self.print();' value='IN'/></center>");
                                                                printWindow.document.close();
                                                                printWindow.focus();
                                                                printWindow.print();
                                                               // printWindow.close();
                }


                                                        </script>
</div>
